# Maintainer: Frederik Schwan <freswa at archlinux dot org>
# Contributor: John D Jones III AKA jnbek <jnbek1972 -_AT_- g m a i l -_Dot_- com>

pkgname=perl-test-mock-guard
pkgver=0.10
pkgrel=5
pkgdesc='Simple mock test library using RAII.'
arch=('any')
url='https://metacpan.org/release/Test-Mock-Guard'
license=('GPL')
depends=('perl-class-load')
options=('!emptydirs' purge)
source=("http://search.cpan.org/CPAN/authors/id/X/XA/XAICRON/Test-Mock-Guard-${pkgver}.tar.gz")
b2sums=('7217eeef03920bdc96ae703607dbcd034b2a495b90296db9d2024e290cbc17e98f20f25f5d3f7fbdf3005b6db66476742fd5af94a954d35075d53f52f2e4fe45')

build() {
  cd Test-Mock-Guard-${pkgver}
  unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1 MODULEBUILDRC=/dev/null
  perl Build.PL
  ./Build
}

check() {
  cd Test-Mock-Guard-${pkgver}
  unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1
  ./Build test
}

package() {
  cd Test-Mock-Guard-${pkgver}
  unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
  ./Build install --installdirs=vendor --destdir "${pkgdir}"
}
